from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np

#定义图像和三维格式坐标轴
fig = plt.figure()  #定义新的三维坐标轴
ax1 = plt.axes(projection='3d')

dx = [0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.25,0.25,0.25,0.25,0.375,0.375,0.5,0.5,0.625,0.625,0.75,0.75,0.75,0.75,0.875,0.875,0.875,0.875,0.875,0.875,0.875,]
dy = [0.125,0.25,0.375,0.5,0.625,0.75,0.875,0.125,0.25,0.75,0.875,0.125,0.875,0.125,0.875,0.125,0.875,0.125,0.25,0.75,0.875,0.125,0.25,0.375,0.5,0.625,0.75,0.875,]
dz = [1.30977,1.47158,1.68162,1.90336,2.16474,2.45459,2.78745,1.46427,1.56864,2.67948,3.13816,1.65961,3.52324,1.85291,3.92723,2.05684,4.36715,2.25045,2.47964,4.2305,4.81555,2.45831,2.77513,3.15611,3.57603,4.06151,4.61894,5.22694,]
ax1.scatter3D(dx,dy,dz)#cmap='Blues')  #绘制散点图
#ax1.plot3D(x,y,z,'gray')    #绘制空间曲线
ax1.set_xlabel('X', color='b')
ax1.set_ylabel('Y', color='g')
ax1.set_zlabel('Z', color='r')
plt.draw()
plt.savefig('i8.png')
plt.show()
